package com.design.memento.football;

/**
 * @author xiemiao
 * @description
 * @date 2023/08/18
 */
public class Client {
    public static void main(String[] args) {
        FootballMatch match = new FootballMatch("比赛开始");
        Memento memento = match.saveStateToMemento();
        Caretaker caretaker = new Caretaker();
        caretaker.addMemento(memento);
        match.setState("中场休息");
        caretaker.addMemento(match.saveStateToMemento());
        System.out.println(match);
        match.restoreStateFromMemento(caretaker.getMemento(0));
        System.out.println(match);

    }
}
